import { pageProjectInterface } from '../services/projectInterface';

export default {
  namespace: 'projectInterface',
  state: {
    currentPage: 1,
    pageSize: 10,
    total: 0,
    list: [],
  },
  effects: {
    *pageProjectInterface({ payload }, { put, call }) {
      const { data } = yield call(pageProjectInterface, payload);
      yield put({
        type: 'pageProjectInterfaceSuccess',
        payload: data,
      });
    },
  },
  reducers: {
    pageProjectInterfaceSuccess(state, { payload }) {
      return {
        ...state,
        ...payload,
      };
    },
  },
};
